using System;
using System.Collections.Generic;
using System.Text;

namespace GuavaData
{
    public class AlterTableRename : Operator
    {
        // DDL statement to rename a table

        #region Fields
        string oldName;
        public string OldName
        {
            get { return oldName; }
            set { oldName = value; }
        }

        string newName;
        public string NewName
        {
            get { return newName; }
            set { newName = value; }
        }
        #endregion Fields

        public AlterTableRename(string oldname, string newname)
        {
            this.oldName = oldname;
            this.newName = newname;
            this.parent = null;
        }

        public override void NotifyChange(Operator old, Operator newOp)
        {
            throw new Exception("The method or operation is not implemented.");
        }
        public override bool isQuery
        {
            get
            {
                return false;
            }
        }
        public override SqlText Visit(Provider qv)
        {
            return qv.Transform(this);
        }
        public override void Visit(Transform t, Command c)
        {
            t.Expand(this, c);
        }
        public override Operator Clone()
        {
            return new AlterTableRename(this.oldName, this.newName);
        }

        public override void Visit(Channel c, string table)
        {
            c.MapAliases(this, table);
        }

    }
}
